package com.ziytek.web.citizen.util;

import com.ziytek.web.citizen.config.caffeine.CaffeineUtil;
import com.ziytek.web.citizen.model.bean.JobTimes;

/**
 * key值获取
 *
 * @author fenghx
 */
public class KeyUtil {

    public static String commandOperateKey(int cabinetNo, int boardNo, int channelNo) {
        return CaffeineUtil.CACHE_KEY_COMMAND_OPERATE + CaffeineUtil.getCacheKey(cabinetNo, boardNo, channelNo);
    }

    public static String commandOperateKey(String cabinetNo, int boardNo, int channelNo) {
        return commandOperateKey(Integer.parseInt(cabinetNo), boardNo, channelNo);
    }

    public static String jobTimesKey(JobTimes jobTimes) {

        return CaffeineUtil.JOB_TIMES + jobTimes.getCabinetNo() +
                CaffeineUtil.CACHE_KEY_SYMBOL + jobTimes.getInterruptOrEndStepId() +
                CaffeineUtil.CACHE_KEY_SYMBOL + jobTimes.getBoardNo() +
                CaffeineUtil.CACHE_KEY_SYMBOL + jobTimes.getChannelNo() +
                CaffeineUtil.CACHE_KEY_SYMBOL + jobTimes.getOrderNo();
        //+ CaffeineUtil.CACHE_KEY_SYMBOL + jobTimes.getSingeType();
    }


}
